﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Client
{
    public partial class Form1 : Form
    {
        ServiceReference1.ServiceClient client = null;

        public Form1()
        {
            InitializeComponent();
            client = new ServiceReference1.ServiceClient();
            //this.FormClosing += (frmsender, frmargs) => client.Close();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            int v;
            if (!int.TryParse(this.textBox1.Text, out v))
            {
                return;
            }
            client.SetValue(v);

        }

        private void button2_Click(object sender, EventArgs e)
        {
            int v = client.GetValue();
            client.EndSession();
            this.textBox2.Text = v.ToString();
        }
    }
}
